package com.wonder.common.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "wonder")
public class WonderConfig {
	
	/** 项目名称 */
    private String name;

    /** 版本 */
    private String version;
    
    /** 项目说明*/
    private String description;

	/** 版权年份 */
    private String copyrightYear;

    /** 实例演示开关 */
    private boolean demoEnabled;

    /** 上传路径 */
    private static String profile;
    
    /** VUE代码路径 */
    private static String appFolder;
    
    /** Moudle Name */
    private static String module;
    
    /** 获取地址开关 */
    private static boolean addressEnabled;
    
    /** 获取文件上传方式ali或本地 */
    private static String uploadType;
    
    
    /** 是否启用google认证 */
    private static boolean googleAuth;
    
    /*是否启用验证*/
    private static boolean captchaEnabled;
    
    
    public static boolean isCaptchaEnabled() {
		return captchaEnabled;
	}
    

	public  void setCaptchaEnabled(boolean captchaEnabled) {
		WonderConfig.captchaEnabled = captchaEnabled;
	}

    public static boolean isGoogleAuth() {
		return googleAuth;
	}
    


	public  void setGoogleAuth(boolean googleAuth) {
		WonderConfig.googleAuth = googleAuth;
	}

	public static String getUploadType() {
		return uploadType;
	}

	public  void setUploadType(String uploadType) {
		WonderConfig.uploadType = uploadType;
	}

	public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }
    
    public static String getModule()
    {
        return module;
    }

    public void setModule(String module)
    {
        this.module = module;
    }


    public String getVersion()
    {
        return version;
    }

    public void setVersion(String version)
    {
        this.version = version;
    }
    
    public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

    public String getCopyrightYear()
    {
        return copyrightYear;
    }

    public void setCopyrightYear(String copyrightYear)
    {
        this.copyrightYear = copyrightYear;
    }

    public boolean isDemoEnabled()
    {
        return demoEnabled;
    }

    public void setDemoEnabled(boolean demoEnabled)
    {
        this.demoEnabled = demoEnabled;
    }

    public static String getProfile()
    {
        return profile;
    }

    public void setProfile(String profile)
    {
    	WonderConfig.profile = profile;
    }

    public static boolean isAddressEnabled()
    {
        return addressEnabled;
    }

    public void setAddressEnabled(boolean addressEnabled)
    {
    	WonderConfig.addressEnabled = addressEnabled;
    }

    /**
     * 获取头像上传路径
     */
    public static String getAvatarPath()
    {
        return getProfile() + "/avatar";
    }

    /**
     * 获取下载路径
     */
    public static String getDownloadPath()
    {
        return getProfile() + "/download/";
    }

    /**
     * 获取上传路径
     */
    public static String getUploadPath()
    {
        return getProfile() + "/upload";
    }

	public static String getAppFolder() {
		return appFolder;
	}

	public void setAppFolder(String appFolder) {
		WonderConfig.appFolder = appFolder;
	}

}
